<template>
  <div>
     <div class="operation">
          <el-form :inline="true" :model="inputform" class="demo-form-inline">
              <el-form-item label="组长名称" >
                <el-input v-model="inputform.groupLeaderName" placeholder="组长名称" ></el-input>
             </el-form-item>
             <el-form-item label="课题编号" >
                <el-input v-model="inputform.groupLeaderName" placeholder="组长名称" ></el-input>
             </el-form-item>
             <el-form-item label="课题名称" >
                <el-input v-model="inputform.groupLeaderName" placeholder="组长名称" ></el-input>
             </el-form-item>
            <el-form-item label="班级">
              <el-select v-model="inputform.courseClassId" placeholder="班级">
                <el-option label="四班" value="4" />
                  <el-option label="二班" value="2" />
                  <el-option label="一班" value="1" />
                  <el-option label="三班" value="3" />
              </el-select>
            </el-form-item>
            <el-form-item>
              <el-button type="primary" @click="selectSubjectInfo">查询</el-button>
            </el-form-item>
          </el-form>


     </div>
     <div class="look_subject">
        <el-table
        :data="tableData"
        style="width: 100%">
          <el-table-column type="selection" width="50" >  
          </el-table-column>
          <el-table-column
            prop="subjectId"
            label="课题编号"
            width="150">
          </el-table-column>
          <el-table-column
            prop="subjectName"
            label="课题名称"
            width="250">
          </el-table-column>
          <el-table-column
            prop="selectedNum"
            label="预选人数"
            width="200">
          </el-table-column> 
          <el-table-column
            prop="groupLeaderName"
            label="组长姓名"
            width="200">
          </el-table-column> 
          <el-table-column
            prop="courseClassId"
            label="班级">
          </el-table-column>        
         <!-- <el-table-column
            fixed="right"
            label="操作"
            width="300">
            <template slot-scope="scope">
              <el-button type="text" size="small" >修改</el-button>
              <el-button type="text" size="small" >删除</el-button>
            </template>
           </el-table-column>-->
        </el-table>
     </div>
  </div>
</template>

<script>
import  api from '@/api/subject/subjectApi'
import  stuapi from '@/api/subject/student'
  export default {
    data() {
      return {
        centerDialogVisible: false,
        tableData: [],
        fileList: [],
        file: {},
        inputform:{}
      }
    },
   
    created(){
      
       this. selectSubjectInfo()
    },
    methods:{
      getSubjectList(){
       api.getsubjectList()
          .then(response=>{
            
            
            this.tableData = response.data
          })
      },
      getgroupLeaderName(id){
          stuapi.getgroupLeaderName(id)
          .then(response=>{
              this.tableData.groupLeaderName = response.data;
          })
      },
      selectSubjectInfo(){
        api.getSubjectInfoVOList(this.inputform)
        .then(responnse =>{
          this.tableData = responnse.data

        })

      }

    }

  }
</script>
<style lang="scss" scoped>
.el-table{
  width:70% !important;
  margin: auto;
    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
}
.operation{
  width: 70%;
  margin: 30px auto;
}

</style>
